package com.atguigu.gmall.item.all.controller;

import com.atguigu.gmall.model.order.OrderInfo;
import com.atguigu.gmall.order.client.OrderFeignClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import javax.servlet.http.HttpServletRequest;

@Controller
@RequestMapping
public class CommentController {

    @Autowired
    private OrderFeignClient orderFeignClient;

    @RequestMapping("comment.html")
    public String addCart(@RequestParam(name = "orderId") Long orderId,
                          HttpServletRequest request){
        //SkuInfo skuInfo = productFeignClient.getSkuInfo(skuId);
        OrderInfo orderInfo = orderFeignClient.getOrderInfo(orderId);

        //request.setAttribute("skuInfo",skuInfo);
        request.setAttribute("orderInfo",orderInfo);
        return "comment/index";
    }

}